home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 43
/
043.d81
/
sector editor
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
19KB
|
815 lines
0 rem *********************************
1 rem ** video ventures disk editor! **
2 rem ** copyright 1987 **
3 rem ** **
4 rem ** programmed by shawn ort **
5 rem *********************************
6 poke53280,12:poke53281,12:poke646,0
8 poke650,128
9 print"[147]";chr$(9);chr$(8);
10 print" [211][197][195][212][207][210] [197][196][201][212][207][210]"
15 print" [194][217] [211][200][193][215][206] [207][210][212] ([195]) 1987"
20 print" [146]"
22 print" 1. [197][196][201][212] [196][201][211][203] [144] [146]"
24 print" 2. [196][201][210][197][195][212][207][210][217] [144] [146]"
26 print" 3. [194][207][207][212] [196][201][211][203] [144] [146]"
28 print" [146]"
30 print" [161] [146][161]"
32 print" [161] [192][178][192] [192][178][192] [192][178][192] [146][161]"
34 print" [161] [173][174] [173][174] [176][189] [146][161]"
36 print" [161] [173][174] [173][174] [176][189] [146][161]"
38 print" [161] [173][174] [173][174][176][189] [146][161]"
40 print" [161] [173][174] [171][189] [146][161]"
42 print" [161] [173][174] [176][189] [146][161]"
44 print" [161] [173][174] [176][189] [146][161]"
46 print" [161] [173][174] [176][189] [146][161]"
48 print" [161] [173][174][176][189] [146][161]"
50 print" [161] [173][189] [146][161]"
52 print" [161] [146][161]"
53 print"[144]"
55 mn$(1)=" 1. [197][196][201][212] [196][201][211][203] [144]"
56 mn$(2)=" 2. [196][201][210][197][195][212][207][210][217] [144]"
57 mn$(3)=" 3. [194][207][207][212] [196][201][211][203] [144]"
58 c=1
59 print"":rem print down
60 forx=1to3
61 ifx=cthen print tab(11);"[158]";mn$(x):goto63
62 print tab(11);"";mn$(x)
63 nextx
64 get a$:ifa$=""then64
65 ifa$="[145]"then69
66 ifa$=""then71
67 ifa$=chr$(13)ora$="1"ora$="2"ora$="3"then75
68 goto64
69 ifc=1thenc=3:goto59
70 c=c-1:goto59
71 ifc=3thenc=1:goto59
72 c=c+1:goto59
75 rem goto routine
76 poke781,23:sys59903:ifa$="1"then100
77 ifa$="2"then1000
78 ifa$="3"then90
80 ifc=1then100
81 ifc=2then1000
82 ifc=3then90
83 run
90 rem ** boot disk **
91 print"[147] [193]re you sure you want to quit? ([217]/[206])"
92 geta$:ifa$=""then92
93 ifa$<>"y"anda$<>"[217]"thenrun
94 open15,8,15,"r:hello connect=hello connect":poke646,12
95 input#15,a$:close15:print"":ifa$="63"then98
96 open15,8,15,"i0":close15:print"[144][201]nsert [204][207][193][196][211][212][193][210] disk!":forx=1to1500:next
97 goto90
98 print"load"chr$(34);"hello connect";chr$(34)",8,1[145][145][145]"
99 poke631,13:poke632,82:poke633,85:poke634,78:poke635,13:poke198,5:end
100 rem *******************************
105 rem ** start of editor program **
110 rem *******************************
115 rem
120 print"[144][197]nter [212]rack:";:gosub1500:ift<>99then122
121 gosub5000:goto120
122 printchr$(9):ift=0thent=18:s=0
124 print"[147]";chr$(14):gosub125:goto225
125 rem ** read block **
126 if t<0 or t>41thenreturn
127 if s>20thenreturn
130 gosub2200:open15,8,15:open2,8,2,"#"
131 j=128:gosub600:gosub155
132 print#15,"m-r"chr$(0)chr$(3)chr$(255)
135 sys49152:rem read and store 1
140 print#15,"m-r"chr$(224)chr$(3)chr$(255)
145 sys49310:rem read and store 2
150 close2:gosub2000:close15:sys49447
155 print"";:forx=1to8:print" [181]";tab(36);"[182]":nextx
160 print" [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]":return
165 rem ** edit and save **
168 gosub400
170 print"[144][212]rack";t;"[157] [211]ector";s;"[157] ":print""
172 print"[206]ext track & sector ";peek(1028);",";peek(1029)
173 print"[208]ress: [198]1[146] to exit without writing"
174 print" [198]3[146] to edit in assembly"
175 print" [198]7[146] to edit in hex or decimal"
176 print"[144][208]ress [210][197][212][213][210][206] [144]when ready to write sector";
179 sys49616
180 p=peek(254):wait207,1:poke204,1:poke198,0
181 ifp=13then194
182 ifp=133then190
183 ifp=134then40000
184 ifp=136then800
185 goto179
190 rem ** exit **
192 print"[147]":sys49447:poke199,0:gosub155:goto225
194 rem ** save **
195 gosub400:poke199,0:poke204,1:sys49342
196 print"[144][146] ";t;",";s:tt=t:ss=s
198 input"[146][145]save at track, sector";t,s
199 if t=tt then ifs=ssthen204
200 print"save at track";t;"sector";s:print"are you sure?"
201 geta$:ifa$=""then201
202 ifa$="y"ora$="[217]"then204
203 ifa$="n"ora$="[206]"thent=tt:s=ss:goto195
204 gosub2200:open2,8,2,"#":open15,8,15:print#15,"b-p:"2;0
205 sys49592
210 print#15,"u2:"2;0;t;s
215 gosub2100:close2:close15:print"[147]":gosub130:goto225
220 rem
225 rem ** sub-menu
230 print""
235 print"[211]-[211]elect track, sector [197]-[197]dit sector"
240 print"[198]-[198]orward [194]-[194]ackward"
245 print"[193]-[193]uto mode [204]-[204]ock/unlock"
246 print"[208]-[208]rint contents [200]-[200]eader info"
247 print"[206]-[206]ext track, sector [216]-[197]xit"
250 print"[144][212]rack";t;"[157] [211]ector";s;"[157] ":print""
251 print"[206]ext [212]rack, [211]ector [157][157][157][157][157][157][157][157]";peek(1028);peek(1029);" "
252 geta$:ifa$=""then252
257 ifa$=""then252
258 ifa$="s"ora$="[211]"then115
260 ifa$="e"ora$="[197]"then165
265 ifa$="f"ora$="[198]"thengosub300:if e<>1thensys49436:gosub155
270 ifa$="b"ora$="[194]"thengosub340:if e<>1thensys49436:gosub155
275 ifa$="a"ora$="[193]"then500
280 ifa$="x"ora$="[216]"then run
281 ifa$="n"ora$="[206]"thengosub450
282 ifa$="p"ora$="[208]"then700
283 ifa$="l"ora$="[204]"then750
284 ifa$="h"ora$="[200]"then1100
285 ifa$="+"thentt=t:t=t-1:gosub3000
286 ifa$="-"thentt=t:t=t+1:gosub3000
287 goto250
300 rem ** forward **
302 s=s+1
305 ift=35ands>16thenaa$="off":s=16:return
310 bq=20
320 ift<18thengosub332:goto325
321 ift<25thengosub334:goto325
322 ift<31thengosub336:goto325
323 ift<41thengosub338:goto325
325 goto125
332 ifs>20thent=t+1:s=0
333 return
334 ifs>18thent=t+1:s=0
335 return
336 ifs>17thent=t+1:s=0
337 return
338 ifs>16thent=t+1:s=0
339 return
340 rem ** backward **
341 s=s-1
342 ift=1ands<0thens=s+1:return
345 ift<19thengosub352:goto350
346 ift<26thengosub354:goto350
347 ift<32thengosub356:goto350
348 ift<36thengosub358:goto350
350 goto130
352 ifs<0thent=t-1:s=20
353 return
354 ifs<0thent=t-1:s=18
355 return
356 ifs<0thent=t-1:s=17
357 return
358 ifs<0thent=t-1:s=16
359 return
400 rem clear bottom window
405 forx=10to25:poke781,x:sys59903:nextx
410 return
450 rem * next track and sector *
452 ifpeek(1028)=0thenreturn
454 ifpeek(1028)>35thenreturn
456 ifpeek(1029)>22thenreturn
458 t=peek(1028):s=peek(1029):goto125
500 rem ** auto mode **
505 gosub400:gosub560:gosub520
510 geta$:ifa$=""then510
512 ifa$="f"ora$="[198]"then530
514 ifa$="b"ora$="[194]"then540
516 ifa$="n"ora$="[206]"then550
518 ifa$="x"ora$="[216]"thengosub400:goto225
519 goto510
520 rem update
522 print"[144][212]rack";t;"[157] [211]ector";s;"[157] ":print""
524 print"[206]ext [212]rack, [211]ector [157][157][157][157][157][157][157][157]";peek(1028);peek(1029);" "
526 return
530 rem auto forward
532 geta$:ifa$="f"ora$="[198]"then500
534 gosub300:gosub520
535 if e<>1thengosub560
536 goto532
540 rem auto backward
542 geta$:ifa$="b"ora$="[194]"then500
544 gosub340:gosub520
545 if e<>1thengosub560
546 goto542
550 rem auto next
552 geta$:ifa$="n"ora$="[206]"then500
553 tt=t:ss=s
554 gosub520:t=peek(1028):s=peek(1029)
556 if t=0thent=tt:s=ss:gosub520:goto500
557 gosub450:ife<>1then500
558 goto550
560 print""
565 print" auto mode"
570 print"[198]-for